<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>js插件2-过渡效果</title>
    <style>
        #mydiv{
            width: 100px;
            height: 100px;
            background: red;
            -webkit-transition: width 2s;
            transition: width 2s;
        }
        #mydiv:hover{
            width: 400px;
        }
    </style>
</head>
<body>
    <div id="mydiv"></div>
    <script>
        document.getElementById("mydiv").addEventListener("transitionend",function(e){
            this.innerHTML="过渡事件已触发-过渡已完成";
        })
    </script>
</body>
</html>